home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / mcu / dtmf.arc / DTMF05.LST < prev    next >
File List  |  1990-01-08  |  17KB  |  299 lines

  1. M6805 Portable Cross Assembler  0.05   MS-DOS/PC-DOS  Page 1
  2.  Mon Jan 08 16:08:42 1990 
  3. Command line: 
  4.  C:\DTMF\PASM05.EXE -l dtmf05.lst dtmf05.asm
  5. Options list: 
  6. ON  - b - Printing of macro definitions
  7. ON  - c - Printing of macro calls
  8. OFF - d - Placing of symbolic debugging information in COFF
  9. OFF - e - Printing of macro expansions
  10. ON  - f - Printing of conditional directives
  11. OFF - g - Printing of generated constants list
  12. OFF - q - Expanding and printing of structured syntax
  13. OFF - s - Printing of symbol table
  14. OFF - u - Printing of conditional unassembled source
  15. OFF - x - Printing of cross reference table
  16. OFF - m - Suppress printing of error messages
  17. ON  - w - Printing of warning messages
  18. OFF - v - Suppress printing of updated status
  19. OFF - y - Enabling of sgs extensions
  20. ON  - o - Create object code
  21. ON  -   - Formatting of source line listing 
  22. Create listing file - l - dtmf05.lst 
  23.  
  24. Xdefs: 
  25.   NONE 
  26.  
  27. Xrefs: 
  28.   NONE 
  29.  
  30. Input file(s): dtmf05.asm (191 lines) 
  31.                sine56.asm (32 lines) 
  32.  
  33. Output file: dtmf05.o  
  34. Listing file: dtmf05.lst 
  35.  
  36. M6805 Portable Cross Assembler  0.05  dtmf05.asm  Page 2
  37.  Mon Jan 08 16:08:42 1990  
  38. Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
  39.  
  40. LINE   S PC   OPCO OPERANDS S LABEL    MNEMO OPERANDS COMMENT
  41. 00001                         * File: DTMF.ASM
  42. 00002                         * Driver routines for 68HC05 to produce DTMF tones in software
  43. 00003                         
  44. 00004                         * this version uses a fixed 256 byte sine table, and a fixed 128 us sample time
  45. 00005                         * this allows operation under interrupt control
  46. 00006                         
  47. 00007                         * hardware requirements: 8 bit DAC on port a of 68HC05
  48. 00008                         * To use, do a JSR to DTINIT to set up timer
  49. 00009                         * then do a JSR to location DTMF with the digit in the lower nibble of
  50. 00010                         * Accumulator A
  51. 00011                         * digit values: 0-9, 10 = #, 11 = *, 12-15 represent a through d
  52. 00012                         * A 60 ms tone burst will be generated, followed by 60 ms of silence
  53. 00013                         * The location TTIME may be altered to change this timing
  54. 00014                         
  55. 00015                                  opt   mul      allow multiply instruction
  56. 00016                                  asct           
  57. 00017                         
  58. 00018                         * define test to be non-zero to create test version
  59. 00019                         
  60. 00020  A 0000      0001     A test     equ   1        
  61. 00021                         
  62. 00022                         * First a few definitions
  63. 00023                         
  64. 00024  A 0000      003c     A deftt    equ   60       default tone time (60 ms)
  65. 00025  A 0000      0000     A dac      equ   $0       DAC output on port a
  66. 00026  A 0000      0004     A dacddr   equ   $4       data direction register for port with DAC
  67. 00027  A 0000      0001     A portb    equ   1        port b address
  68. 00028  A 0000      0005     A ddrb     equ   5        ... and its ddr
  69. 00029  A 0000      0018     A ctrhi    equ   $18      timer free running counter
  70. 00030  A 0000      0019     A ctrlo    equ   $19      
  71. 00031  A 0000      0016     A ocrhi    equ   $16      output compare register
  72. 00032  A 0000      0017     A ocrlo    equ   $17      
  73. 00033  A 0000      0012     A tcr      equ   $12      timer control register
  74. 00034  A 0000      0040     A ocie     equ   $40      output compare interrupt enable
  75. 00035  A 0000      0013     A tsr      equ   $13      timer status register
  76. 00036  A 0000      0006     A ocf      equ   6        output compare flag bit position
  77. 00037  A 0000      0040     A intcnt   equ   128/2    count to load into output compare
  78. 00038                         
  79. 00039  A 0000      0017     A row1     equ   23       row intervals
  80. 00040  A 0000      0019     A row2     equ   25       
  81. 00041  A 0000      001c     A row3     equ   28       
  82. 00042  A 0000      001f     A row4     equ   31       
  83. 00043                         
  84. 00044  A 0000      0028     A col1     equ   40       column intervals
  85. 00045  A 0000      002c     A col2     equ   44       
  86. 00046  A 0000      0030     A col3     equ   48       
  87. 00047  A 0000      0036     A col4     equ   54       
  88. 00048                         
  89. 00049  A 0050                          org   $50      RAM scratchpad - move this to fit your system
  90. 00050  A 0050      01       A ttime    rmb   1        tone time in milliseconds
  91. 00051  A 0051      02       A ttctr    rmb   2        time counter
  92. 00052  A 0053      02       A ttsave   rmb   2        save the count value for interdigit pause
  93.  
  94. M6805 Portable Cross Assembler  0.05  dtmf05.asm  Page 3
  95.  Mon Jan 08 16:08:42 1990  
  96. Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
  97.  
  98. LINE   S PC   OPCO OPERANDS S LABEL    MNEMO OPERANDS COMMENT
  99. 00053  A 0055      01       A ttflag   rmb   1        non zero means generate tones
  100. 00054  A 0056      01       A rowptr   rmb   1        next row sample to load
  101. 00055  A 0057      01       A colptr   rmb   1        ditto for columns
  102. 00056  A 0058      01       A rowint   rmb   1        row interval - added to row counter each sample
  103. 00057  A 0059      01       A colint   rmb   1        ditto for column
  104. 00058  A 005a      01       A sample   rmb   1        temp storage for sample
  105. 00059                         
  106. 00060  A 1000                          org   $1000    
  107. 00061  A 1000 9b              dtinit   sei            disable interrupts
  108. 00062                                  ifne  test     
  109. 00063  A 1001 9c                       rsp            set default stack
  110. 00064                                  endc           
  111. 00065  A 1002 a6   3c       A          lda   #deftt   set up time counter
  112. 00066  A 1004 b7   50       A          sta   ttime    
  113. 00067  A 1006 a6   ff       A          lda   #$ff     set up ddr - all outputs
  114. 00068  A 1008 b7   04       A          sta   dacddr   
  115. 00069                                  ifne  test     
  116. 00070  A 100a b7   05       A          sta   ddrb     set up port b to flag entry to interrupt
  117. 00071  A 100c 3f   01       A          clr   portb    
  118. 00072                                  endc           
  119. 00073  A 100e a6   80       A          lda   #$80     set dac to halfway point
  120. 00074  A 1010 b7   00       A          sta   dac      
  121. 00075  A 1012 3f   55       A          clr   ttflag   no tones please
  122. 00076  A 1014 a6   40       A          lda   #ocie    enable output compare interrupt
  123. 00077  A 1016 b7   12       A          sta   tcr      
  124. 00078  A 1018 b6   18       A          lda   ctrhi    freeze counter
  125. 00079  A 101a b7   16       A          sta   ocrhi    
  126. 00080  A 101c b6   19       A          lda   ctrlo    
  127. 00081  A 101e ab   40       A          add   #intcnt  
  128. 00082  A 1020 24   02    1024          bcc   dti1     
  129. 00083  A 1022 3c   16       A          inc   ocrhi    
  130. 00084  A 1024 3d   13       A dti1     tst   tsr      
  131. 00085  A 1026 b7   17       A          sta   ocrlo    
  132. 00086  A 1028 9a                       cli            
  133. 00087                                  ifeq  test     
  134. 00089                                  endc           
  135. 00090                                  ifne  test     
  136. 00091  A 1029 9d                       nop            
  137. 00092  A 102a 20   fe    102a here     bra   here     endless loop
  138. 00093                                  endc           
  139. 00094                         
  140. 00095  A 102c a4   0f       A dtmf     and   #$0f     clear out junk
  141. 00096  A 102e 97                       tax            get row interval
  142. 00097  A 102f d6   10bc     A          lda   rowtab,x 
  143. 00098  A 1032 b7   58       A          sta   rowint   
  144. 00099  A 1034 d6   10ac     A          lda   coltab,x and column
  145. 00100  A 1037 b7   59       A          sta   colint   
  146. 00101  A 1039 3f   56       A          clr   rowptr   start at 0
  147. 00102  A 103b 3f   57       A          clr   colptr   
  148. 00103  A 103d b6   50       A          lda   ttime    start tone - set time
  149. 00104  A 103f ae   fa       A          ldx   #250     adjust for # of samples in (ttime) msec
  150. 00105  A 1041 42                       mul            (125/128) * ttime * 8
  151.  
  152. M6805 Portable Cross Assembler  0.05  dtmf05.asm  Page 4
  153.  Mon Jan 08 16:08:42 1990  
  154. Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
  155.  
  156. LINE   S PC   OPCO OPERANDS S LABEL    MNEMO OPERANDS COMMENT
  157. 00106  A 1042 4f                       clra           x now contains adjusted sample count
  158. 00107  A 1043 58                       aslx           multiply by 8 to produce sample count
  159. 00108  A 1044 49                       rola           
  160. 00109  A 1045 58                       aslx           
  161. 00110  A 1046 49                       rola           
  162. 00111  A 1047 58                       aslx           
  163. 00112  A 1048 49                       rola           
  164. 00113  A 1049 43                       coma           
  165. 00114  A 104a 50                       negx           negate so tisr can increment
  166. 00115  A 104b 25   01    104e          bcs   dtmf05   carry if necessary
  167. 00116  A 104d 4c                       inca           
  168. 00117  A 104e b7   51       A dtmf05   sta   ttctr    put into timer
  169. 00118  A 1050 bf   52       A          stx   ttctr+1  
  170. 00119  A 1052 b7   53       A          sta   ttsave   save for pause time
  171. 00120  A 1054 bf   54       A          stx   ttsave+1 
  172. 00121  A 1056 3c   55       A          inc   ttflag   start tones
  173. 00122  A 1058 00   55fd  1058 dtmf1    brset 0,ttflag,dtmf1 loop till tone complete
  174. 00123  A 105b b6   53       A          lda   ttsave   now do pause
  175. 00124  A 105d b7   51       A          sta   ttctr    
  176. 00125  A 105f b6   54       A          lda   ttsave+1 
  177. 00126  A 1061 b7   52       A          sta   ttctr+1  
  178. 00127  A 1063 3f   58       A          clr   rowint   do the pause by not moving pointers
  179. 00128  A 1065 3f   59       A          clr   colint   
  180. 00129  A 1067 3c   55       A          inc   ttflag   start pause
  181. 00130  A 1069 00   55fd  1069 dtmf2    brset 0,ttflag,dtmf2
  182. 00131  A 106c 81                       rts            done
  183. 00132                         
  184. 00133                         * timer interrupt service routine
  185. 00134                         * if ttctr != 0, then output next sample to dac
  186. 00135                         
  187. 00136                         tisr     ifne  test     
  188. 00137  A 106d 10   01       A          bset  0,portb  
  189. 00138                                  endc           
  190. 00139  A 106f b6   17       A          lda   ocrlo    (3) add timer count
  191. 00140  A 1071 ab   40       A          add   #intcnt  (2)
  192. 00141  A 1073 24   02    1077          bcc   tisr2    (3) do carry if needed
  193. 00142  A 1075 3c   16       A          inc   ocrhi    (5)
  194. 00143  A 1077 3d   13       A tisr2    tst   tsr      (4) clear flag
  195. 00144  A 1079 b7   17       A          sta   ocrlo    (4)
  196. 00145  A 107b 01   552b  10a9          brclr 0,ttflag,tisr1 (5) don't generate tone if flag cleared
  197. 00146  A 107e be   56       A          ldx   rowptr   (3) get next row sample
  198. 00147  A 1080 d6   10cc     A          lda   sine,x   (5)
  199. 00148  A 1083 b7   5a       A          sta   sample   (4)
  200. 00149  A 1085 9f                       txa            (2) update pointer
  201. 00150  A 1086 bb   58       A          add   rowint   (3)
  202. 00151  A 1088 b7   56       A          sta   rowptr   (4)
  203. 00152  A 108a be   57       A          ldx   colptr   (3) get next col sample
  204. 00153  A 108c d6   10cc     A          lda   sine,x   (5)
  205. 00154  A 108f 47                       asra           (3) divide by 4
  206. 00155  A 1090 47                       asra           (3) divide by 4
  207. 00156  A 1091 db   10cc     A          add   sine,x   (5) now have 1.25 * column sample
  208. 00157  A 1094 bb   5a       A          add   sample   (3) add to row sample
  209.  
  210. M6805 Portable Cross Assembler  0.05  dtmf05.asm  Page 5
  211.  Mon Jan 08 16:08:42 1990  
  212. Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
  213.  
  214. LINE   S PC   OPCO OPERANDS S LABEL    MNEMO OPERANDS COMMENT
  215. 00158  A 1096 a8   80       A          eor   #$80     (2) fix sign bit
  216. 00159  A 1098 b7   00       A          sta   dac      (4) out it goes
  217. 00160  A 109a 9f                       txa            (2) update pointer
  218. 00161  A 109b bb   59       A          add   colint   (3)
  219. 00162  A 109d b7   57       A          sta   colptr   (4)
  220. 00163  A 109f 3c   52       A          inc   ttctr+1  (5) increment timer
  221. 00164  A 10a1 26   06    10a9          bne   tisr1    (3) carry needed?
  222. 00165  A 10a3 3c   51       A          inc   ttctr    (5) yes - do it
  223. 00166  A 10a5 26   02    10a9          bne   tisr1    (3) overflow?
  224. 00167  A 10a7 3f   55       A          clr   ttflag   yes - turn off tones
  225. 00168                         tisr1    ifne  test     
  226. 00169  A 10a9 11   01       A          bclr  0,portb  
  227. 00170                                  endc           
  228. 00171  A 10ab 80                       rti            (9)
  229. 00172                         *                (7) interrupt response
  230. 00173                         *                ===
  231. 00174                         *                               116 cycles when generating tones
  232. 00175                         *                total overhead at 2 MHz E clock = 116/256 == 45%
  233. 00176                         
  234. 00177  A 10ac      2c282c30 A coltab   fcb   col2,col1,col2,col3 0,1,2,3
  235. 00178  A 10b0      282c30   A          fcb   col1,col2,col3 4,5,6
  236. 00179  A 10b3      282c30   A          fcb   col1,col2,col3 7,8,9
  237. 00180  A 10b6      2830     A          fcb   col1,col3 #,*
  238. 00181  A 10b8      36363636 A          fcb   col4,col4,col4,col4 a,b,c,d
  239. 00182                         
  240. 00183  A 10bc      1f171717 A rowtab   fcb   row4,row1,row1,row1 0,1,2,3
  241. 00184  A 10c0      191919   A          fcb   row2,row2,row2 4,5,6
  242. 00185  A 10c3      1c1c1c   A          fcb   row3,row3,row3 7,8,9
  243. 00186  A 10c6      1f1f     A          fcb   row4,row4 #,*
  244. 00187  A 10c8      17191c1f A          fcb   row1,row2,row3,row4 a,b,c,d
  245. 00188                         
  246. 00189                                  include sine56.asm
  247. 00001  A 10cc      00010304 A sine     fcb   0,1,3,4,5,7,8,10
  248. 00002  A 10d4      0b0c0e0f A          fcb   11,12,14,15,16,18,19,20
  249. 00003  A 10dc      15171819 A          fcb   21,23,24,25,26,28,29,30
  250. 00004  A 10e4      1f202122 A          fcb   31,32,33,34,36,37,38,39
  251. 00005  A 10ec      2829292a A          fcb   40,41,41,42,43,44,45,46
  252. 00006  A 10f4      2f2f3031 A          fcb   47,47,48,49,49,50,51,51
  253. 00007  A 10fc      34343535 A          fcb   52,52,53,53,54,54,54,55
  254. 00008  A 1104      37373738 A          fcb   55,55,55,56,56,56,56,56
  255. 00009  A 110c      38383838 A          fcb   56,56,56,56,56,56,55,55
  256. 00010  A 1114      37373636 A          fcb   55,55,54,54,54,53,53,52
  257. 00011  A 111c      34333332 A          fcb   52,51,51,50,49,49,48,47
  258. 00012  A 1124      2f2e2d2c A          fcb   47,46,45,44,43,42,41,41
  259. 00013  A 112c      28272625 A          fcb   40,39,38,37,36,34,33,32
  260. 00014  A 1134      1f1e1d1c A          fcb   31,30,29,28,26,25,24,23
  261. 00015  A 113c      15141312 A          fcb   21,20,19,18,16,15,14,12
  262. 00016  A 1144      0b0a0807 A          fcb   11,10,8,7,5,4,3,1
  263. 00017  A 114c      00fffdfc A          fcb   0,-1,-3,-4,-5,-7,-8,-10
  264. 00018  A 1154      f5f4f2f1 A          fcb   -11,-12,-14,-15,-16,-18,-19,-20
  265. 00019  A 115c      ebe9e8e7 A          fcb   -21,-23,-24,-25,-26,-28,-29,-30
  266. 00020  A 1164      e1e0dfde A          fcb   -31,-32,-33,-34,-36,-37,-38,-39
  267.  
  268. M6805 Portable Cross Assembler  0.05  sine56.asm  Page 6
  269.  Mon Jan 08 16:08:42 1990  
  270. Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
  271.  
  272. LINE   S PC   OPCO OPERANDS S LABEL    MNEMO OPERANDS COMMENT
  273. 00021  A 116c      d8d7d7d6 A          fcb   -40,-41,-41,-42,-43,-44,-45,-46
  274. 00022  A 1174      d1d1d0cf A          fcb   -47,-47,-48,-49,-49,-50,-51,-51
  275. 00023  A 117c      cccccbcb A          fcb   -52,-52,-53,-53,-54,-54,-54,-55
  276. 00024  A 1184      c9c9c9c8 A          fcb   -55,-55,-55,-56,-56,-56,-56,-56
  277. 00025  A 118c      c8c8c8c8 A          fcb   -56,-56,-56,-56,-56,-56,-55,-55
  278. 00026  A 1194      c9c9caca A          fcb   -55,-55,-54,-54,-54,-53,-53,-52
  279. 00027  A 119c      cccdcdce A          fcb   -52,-51,-51,-50,-49,-49,-48,-47
  280. 00028  A 11a4      d1d2d3d4 A          fcb   -47,-46,-45,-44,-43,-42,-41,-41
  281. 00029  A 11ac      d8d9dadb A          fcb   -40,-39,-38,-37,-36,-34,-33,-32
  282. 00030  A 11b4      e1e2e3e4 A          fcb   -31,-30,-29,-28,-26,-25,-24,-23
  283. 00031  A 11bc      ebecedee A          fcb   -21,-20,-19,-18,-16,-15,-14,-12
  284. 00032  A 11c4      f5f6f8f9 A          fcb   -11,-10,-8,-7,-5,-4,-3,-1
  285. 00190                         
  286. 00191                                  end            
  287.  
  288.  
  289.  
  290. Total number of errors: 0 
  291. Total number of warnings: 0 
  292. Total number of lines: 223 
  293.  
  294.  
  295. Number of bytes in section ASCT: 471 
  296.  
  297. Number of bytes in program: 471
  298.  
  299.